var vm_qushiquerenlist = new Vue({
	el : "#qushiquerenlist",
	data : {
		deptid : $("#deptid").val(),		// deptid

		qushiquerenlist : [],// 趋势确认列表custom


		//查询用字段
		xingming : '',
		suoshudanwei : '',
		shenfenzhenghao : '',
		siwangbiaoji : 99,
		shifouchuli : 99,

		pageindex : 1,		// 查询分页初始化页
		pagesize : 10,		// 查询分页初始化页面大小
		pageCount : 0,		// 总页数
		recordCount : 0,	// 总记录数
		targetpage : '', 	// 目标页

	},
	created : function(){
		var _this = this;
		_this.bindQushiquerenList();

	},
	watch : {
		//监控分页情况，刷新列表
		pageindex : function(){
			this.bindQushiquerenList();
		},

		pagesize : function(){
			this.bindQushiquerenList();
		},
	},
	methods : {

		bindQushiquerenList : function(){
			var _this = this;
			$.post('/system/zhuanjiaqushiqueren/customlist', {
				deptid : _this.deptid,
				zhuanjiaxingming : _this.xingming,
				suoshudanwei : _this.suoshudanwei,
				shenfenzhenghao : _this.shenfenzhenghao,
				siwangbiaoji : _this.siwangbiaoji,
				shifouchuli : _this.shifouchuli,
				pageindex : _this.pageindex,
				pagesize : _this.pagesize,
				rdm : Math.random()
			},function(ppData) {
				if (ppData.result == "1") {
					var data = ppData.resultContent;
					_this.qushiquerenlist = data.list;
					var pageInfo = data.PageInfo;
					_this.pageindex = pageInfo.pageIndex;
					_this.pageCount = pageInfo.pageCount;
					_this.recordCount = pageInfo.recordCount;
					_this.targetpage = '';
				}
			},"json");
		},


		//首页
		firstPage : function(){
			this.pageindex = 1;
		},
		//尾页
		lastPage : function(){
			this.pageindex = this.pageCount;
		},
		//上一页
		prePage : function(){
			var prePage = ((this.pageindex -1) <= 0) ? 1 : (this.pageindex -1);
			this.pageindex = prePage;
		},
		//下一页
		nextPage : function(){
			var nextPage = ((this.pageindex +1) >= this.pageCount) ? this.pageCount : (this.pageindex +1);
			this.pageindex = nextPage;
		},
		//跳到目标页
		targetPage : function() {
			if( this.targetpage != '' && this.targetpage <= this.pageCount && this.targetpage > 0){
				this.pageindex = this.targetpage;
				this.targetpage = '';
			}
		},

		reset :function () {
			var _this = this
			_this.xingming = '',
				_this.suoshudanwei = '',
				_this.shenfenzhenghao = '',
				_this.siwangbiaoji = 99,
				_this.shifouchuli = 99,
				_this.pageindex = 1,
				_this.pagesize = 10,
				_this.pageCount = 0,
				_this.recordCount = 0,
				_this.targetpage = ''
			_this.bindQushiquerenList()
		},




	},
})